{extend name="user_base" /} {block name="seo"}
<title>我的评论 - {$site_config['seo_title']}</title>
<meta name="keywords" content="{$site_config['seo_keyword']}">
<meta name="description" content="{$site_config['seo_description']}">
{/block}
{block name="css"}
{/block}
{block name="main"}
<div class="title">
    我的评论<font>您已评论<i>0</i>条，回复<i> 0 </i>条</font>
</div>
<div class="loadings layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></div>
<ul class="pl-lists"></ul>
{/block}
{block name="script"}
<!-- 我的评论列表 -->
<script id="pl-list" type="text/html">
    {{#if(d.count<1){}}
    <div class="no-data">
        <i class="iconfont icon-zanwujilu" style="color: #cccccc;"></i>
        <span>您还从未评论过哦！快去浏览教程,发表自己的看法吧</span>
    </div>
    {{#}else{}}
    {{#  layui.each(d.data, function(index, item){ }}
    <li>
        <div class="info">
            <div class="cons">
                {{#if(item.status==2){}}
                <i>待审核</i>
                {{#}}}
                {{item.content}}
            </div>
            <div class="dec layui-clear">
                <div class="left">{{item.created_at}}</div>
                <a class="right" href="/html/{{item.id}}.html" target="_blank">来自：{{item.title}}</a>
            </div>
        </div>
    </li>
    {{#  }); }}
    {{#}}}
</script>
<script>
    layui.use(['laytpl','flow'],function() {
        var laytpl = layui.laytpl;
        var flow = layui.flow;
        flow.load({
            elem: '.pl-lists',
            isAuto:false,
            done: function(page, next) {
                getPL(page,next);
            }
        });


        function getPL(page,next) {
            request({
                loading:false,
                data:{
                    'page':page
                },
                success:function (result) {
                    result = result.data;
                    var pl=0;
                    var hf=0;
                    if(result.data.length){

                        $.each(result.data,function (i,v) {
                            if(v.pid){hf++;}else{pl++;}
                        });
                        if(result.count<=result.limit){
                            result.pl =pl;
                            result.hf =pl;
                        }
                    }

                    if(page===1){
                        $(".loadings").hide();
                        $(".layui-flow-more").show();
                        $(".title font i").eq(0).html(pl);
                        $(".title font i").eq(1).html(hf);
                    }
                    if (result.pages==0){
                        $('.layui-flow-more').hide();
                    }
                    laytpl($("#pl-list").html()).render(result, function(html){
                        next(html, page < result.pages);
                    });

                }
            })
        }

    });
</script>
{/block}